const http = require("http");
const fs = require("fs");

http.createServer((req,res)=>{
	console.log("访问了")
	console.log(Object.keys(req))
	console.log(req.url)
	console.log(`webapps${req.url}`)
	fs.readFile(`webapps${req.url}`,(err,data)=>{
		if(err){
			res.writeHeader(404);
			res.write("Not Found");
		}else{
			res.write(data);
		}
		res.end();
	});
}).listen(8080);
